package com.swingson.properties.impl;

import com.swingson.SwingsonGui;
import com.swingson.event.ValueEvent;
import com.swingson.jsonparser.JsonElement;
import javax.swing.JComponent;

/**
 * @author Dmitry
 */
public class NgVisiblePropertyProcessor extends BaseMvelPropertyProcessor {

    @Override
    public ValueEvent getEvent(JsonElement jsonElement, final JComponent component, SwingsonGui gui) {
        return new ValueEvent() {
            @Override
            protected void valueChanged(Object value) {
                component.setVisible(isTrue(value));
            }
        };
    }
}
